<?php TPL::output('global/header.tpl.htm'); ?>

<div class="bd pbd"> 

  <!--right_nav_s-->
	<?php TPL::output('topic/sidebar.tpl.htm');?>
  <!--right_nav_e--> 
  <!--left_nav_s-->
  <div class="contant_left pfo  DIS_top discussion_element">
    <div id="Manytopics" class="shd"  style="margin:10px 30px;">
      <div class="add_C" id="addtxt">
        <?php if($this->topic_parent_list){ ?>
        <?php foreach($this->topic_parent_list as $key => $val){ ?>
        <span val="<?php echo $val['topic_title']; ?>" id="<?php echo $val['topic_id']; ?>"><a href="topic/<?php echo $val['topic_title']; ?>" rel="<?php echo $val['topic_id']; ?>" title="<?php echo $val['topic_title']; ?>" onmouseover="eventstalk(this);"><?php echo $val['topic_title']; ?></a><em onclick="removeChilds(this)" class="hide">x</em></span>
        <?php } ?>
        <?php } ?>
      </div>
   
	  <?php if ($this->user_info['permission']['edit_topic'] OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) {?>
      <a href="javascript:void(0);" class="editor" id="editor" onclick="hide('editorInput','editor','editorInput','editor hide',this)">话题编辑</a>
      <?php } ?>
	  
      <div class="editorInput hide" id="editorInput">
        <div id="ajaxDate" class="hide">
          <div class="add" onclick="add('take');">添加 <span id="take" ></span>话题</div>
          <div id="txt"></div>
        </div>
        <input type="text" class="i_add" name="addName">
        <a href="javascript:void(0);" class="finish" onclick="hide('editor','editorInput','editor ','editorInput hide',this);addElementVALUE();">完成</a>
        <p id="err" class="cr hide">请勿重复添加话题！</p>
      </div>
    </div>
    <ul class="ur default_anwsion">
      <li class="lr" onmouseover="elementClickEvent.letter.default_Evs(event);" ><img src="<?php if($this->topic_info['topic_pic']){?><?php
	  echo   get_setting('upload_url').'/topic/'.
str_replace(AWS_APP::config()->get('image')->topic_thumbnail['min']['w'].'_'.AWS_APP::config()->get('image')->topic_thumbnail['min']['h'], AWS_APP::config()->get('image')->topic_thumbnail['max']['w'].'_'.AWS_APP::config()->get('image')->topic_thumbnail['max']['h'], $this->topic_info['topic_pic']);?><?php } else { ?><?php echo G_STATIC_URL; ?>/common/topic-max-img.jpg<?php } ?>" alt="" <?php if ($this->user_info['permission']['edit_topic'] OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) {?> id="edit_topic_pic"<?php } ?>/>
        <?php if ($this->user_info['permission']['edit_topic'] OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) {?>
		<?php if ($this->topic_info['topic_lock'] == 0){ ?>
        <a class="editor_htFace hide" title="编辑" href="javascript:;">编辑</a>
        <?php } ?>
		<?php } ?>
      </li>
      <li class="lsr">
        <p class="default_ed"><span id="topic_title"><b class="tx" val="<?php echo $this->topic_info['topic_title']; ?>"><?php echo $this->topic_info['topic_title']; ?></b></span>
          <?php if ($this->topic_info['topic_lock'] == 0) { ?>
          <?php if ($this->user_info['permission']['edit_topic'] OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) {?>
          <a href="#" title="编辑" onclick="ajax_edit($('#topic_title'), $('#topic_title b'), G_BASE_URL+'/topic/ajax/modfiy_topic_title/topic_id-<?php echo $this->topic_info['topic_id']; ?>', false, false); return false;" class="editorTxt">编辑</a>
          <?php } ?>
          <?php } ?>
        </p>
        <div class="xfo"> <span id="XFO_Text">
          <?php if ($this->topic_info['topic_description']) { echo nl2br($this->topic_info['topic_description']); } else { echo "请为话题编辑头像和详细说明..."; } ?>
          </span>
          <p style="display:inline;">
           <?php if ($this->user_info['permission']['edit_topic'] OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) {?>
			<?php if ($this->topic_info['topic_lock'] == 0) { ?>
            <a href="javascript:;" id="default_edite" title="编辑" onclick="ajax_edit($('#XFO_Text'), $('#XFO_Text'),G_BASE_URL+ '/topic/ajax/modify_topic_desc/topic_id-<?php echo $this->topic_info['topic_id']; ?>__target_id-XFO_Text', false, true); return false;" class="editorTxt">编辑</a>
            <?php } ?>
			<?php } ?>
          </p>
        </div>
        <div class="default_SZ default_xfo_txt"><?php if ($this->user_id) { ?><a title="加" class="default_blue_but<?php if ($this->topic_info['has_focus']) { ?> cur <?php } ?>" href="javascript:;" onclick="focus_topic($(this), $(this), <?php echo $this->topic_info['topic_id']; ?>); return false;"><?php if ($this->topic_info['has_focus']) { ?>取消<?php } ?>关注</a><?php } ?> <a onclick="elementClickEvent.letter.default_anonymity(event);" title="设置" href="javascript:" class="default_set"></a>
          <p class="default_setPosition hide"><a title="修改记录" href="topic/log/topic_title-<?php echo $this->topic_info['topic_title']; ?>">话题日志</a></p>
        </div>
      </li>
    </ul>
  </div>
  <div class="contant_left readns_discus dis_ListEntry index">
    <h2 class="c_title">
      <ul class="default_question">
        <li><a onclick="elementClickEvent.letter.default_question(this,0,'');" class="cur" href="javascript:;">所有问题<span class="default_nums"><?php echo $this->topic_info['topic_count'];?></span></a></li>
       
        <li><a onclick="elementClickEvent.letter.default_question(this,1,'');" href="javascript:;">等待回复<span class="default_nums"><?php echo $this->no_answer_question_count; ?></span></a></li>
		
<li><a onclick="elementClickEvent.letter.default_question(this,2,'');" href="javascript:;">最佳讨论<span class="default_nums"><?php echo $this->best_question_count; ?></span></a></li>	
      </ul>
    </h2>
    <div id="layer_0">
      <div id="c_all_list">
        <p style="padding: 15px 0" align="center"><img src="<?php echo G_STATIC_URL; ?>/common/loading_b.gif" alt="" /></p>
      </div>
      <div class="moreDiv" id="bp_all_more"><a href="#" class="mores">更多<em></em></a></div>
    </div>
    <div id="layer_1" class="hide">
      <div id="c_noanswer_list">
        <p style="padding: 15px 0" align="center"><img src="<?php echo G_STATIC_URL; ?>/common/loading_b.gif" alt="" /></p>
      </div>
      <div class="moreDiv" id="bp_noanswer_more"><a href="#" class="mores">更多<em></em></a></div>
    </div>
<div id="layer_2" class="hide">
      <div id="c_best_question_list">
        <p style="padding: 15px 0" align="center"><img src="<?php echo G_STATIC_URL; ?>/common/loading_b.gif" alt="" /></p>
      </div>
      <div class="moreDiv" id="bp_best_question_more"><a href="#" class="mores">更多<em></em></a></div>
    </div>	
  </div>
  <!--left_nav_e--> 
</div>
<script type="text/javascript">
	var TOPIC_ID = '<?php echo $this->topic_info['topic_id']; ?>';
</script> 
<script src="<?php echo G_STATIC_URL; ?>/js/topic.js" type="text/javascript"></script>
<?php TPL::output('global/footer.tpl.htm'); ?>
